package org.example.order;

import com.alipay.remoting.exception.CodecException;
import com.alipay.remoting.serialization.SerializerManager;
import lombok.Builder;
import lombok.Data;
import org.example.command.OrderCmd;

import java.io.Serializable;

@Builder
@Data
public class MatchData implements Serializable {

    public long timestamp;

    public int mid;

    public long oid;

    public OrderStatus status;

    public long tid;

    //撤单数量 成交数量
    public long volume;

    public long price;

    public byte[] serialize() throws CodecException {
        return SerializerManager.getSerializer(SerializerManager.Hessian2).serialize(this);
    }

    public static MatchData deserialize(byte[] source) throws CodecException {
        return SerializerManager.getSerializer(SerializerManager.Hessian2).deserialize(source,MatchData.class.getName());
    }

}
